package com.sky.ContactManager;




import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class Main extends Activity implements OnClickListener {
	
	EditText login;
	EditText motdepasse;
	Button connexion;
	String abonnee;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        
        login =(EditText)this.findViewById(R.id.editText1);
		motdepasse =(EditText)this.findViewById(R.id.editText2);
		connexion =(Button)this.findViewById(R.id.button1);
		connexion.setOnClickListener(this);
    }
	@Override
	public void onClick(View arg0) {
		// TODO Auto-generated method stub
		
					
					Log.d("d", "a");
					 Transfert transfert=new Transfert(Main.this);
					// pr.setMessage("chargement des produits...");
					 abonnee= transfert.ServerData();    
					 Log.d("contacts", abonnee);
					/*Main.this.motdepasse.setText("");
					Main.this.login.setText("");
						*/	
						
					
					Main.this.startactivity();
					//pr.dismiss();
					//pr.dismiss();
				//myViewUpdateHandler.post(runInuiThread);

	}
	
	public void startactivity()
	{   Log.d("bicho","bicho1");
		Intent intent = new Intent(this,Contacts.class);
		Log.i("login", login.getText().toString());
		intent.putExtra("abonnee", abonnee);
		
		this.startActivityForResult(intent, 1000);
		Log.d("bicho","bicho3");
	}
}